<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="models.beans.*, models.entity.*"%>

<jsp:useBean id="usuario" class="models.beans.UsuarioBean" scope="request"></jsp:useBean>

<jsp:setProperty property="id" name="usuario" />

<% Usuario user = usuario.findById();%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Formulario Usuario</title>
 <link rel="stylesheet" type="text/css" href="../css/estilo.css">
</head>
<body>
<h3>Formulario Usuario</h3>


<form method="post" action="<%= application.getContextPath() %>/catalogo/guardarusuario.jsp" name='form1'>
    <input type="hidden" name="id" value="<%=user.getId()%>"/>
    <table border="1" width="500">
        <tbody>
            <tr>
                <td><span>Nombre</span></td>
                <td><input size="40" type="text" name="nombre" value="<%=user.getNombre()==null?"":user.getNombre()%>"/></td>
            </tr>
            <tr>
                <td><span>Apellido</span></td>
                <td><input type="text" name="apellido" value="<%=user.getApellido()==null?"":user.getApellido()%>"/></td>
            </tr>
            <tr>
                <td><span>User</span></td>
                <td><input type="text" name="user" value="<%=user.getUser()==null?"":user.getUser()%>"/></td>
            </tr>
               <tr>
                <td><span>Clave</span></td>
                <td><input type="text" name="clave" value="<%=user.getClave()==null?"":user.getClave()%>"/></td>
            </tr>
              <tr>
                <td><span>Privilegio</span></td>
                <td><select name="privilegio">
                        <option>Seleccione</option>
                        <option value='0'>Cliente</option>
                        <option value='1'>Empleado</option>
                    </select>    
                    <script>
                        document.form1.privilegio.value="<%=user.getPrivilegio()%>";
                    </script>    
                </td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" name="guardar" value="Guardar"/></td>
            </tr>
        </tbody>
    </table>
</form>
</body>
</html>